<template>
  <el-config-provider :size="store.size" :locale="locale">
    <RouterView />
  </el-config-provider>
</template>
<script lang="ts" setup>
import { useAppStore } from "./stores/app"
// 语言 英文
import en from "element-plus/dist/locale/en.mjs"
// 语言 中文
import zhCn from "element-plus/dist/locale/zh-cn.mjs"
// 主题修改 1. 导入 useGenerateTheme
import { useGenerateTheme } from "@/hooks/useGenerateTheme"
const language = ref("zh-cn")
// 控制语言判断
const locale = computed(() => (language.value === "zh-cn" ? zhCn : en))

const store = useAppStore() // store.size ===> 控制按钮尺寸

// 主题修改 2. watch主题
useGenerateTheme()
</script>
<style scoped></style>
